
using Microsoft.AspNetCore.Mvc.Filters;

namespace SB2.Core;
public class PermissionCheckAttribute : ActionFilterAttribute
{
    string[] _codes;
    public PermissionCheckAttribute(params string[] codes)
    {
        _codes = codes ?? new string[0] { };

    }
    public bool Check(List<string> PermissionCodes)
    {
        return _codes.Any(m => PermissionCodes.Contains(m));
    }
}